package examples;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;

import com.hyperrealm.kiwi.ui.*;
import com.hyperrealm.kiwi.ui.dialog.*;
import com.hyperrealm.kiwi.util.*;

public class PanelTest extends KFrame
{
  private JTextField t_one, t_two, t_three, t_four;
  private KButton b_one, b_two;
  public static void main(String args[])
  {
    PanelTest t = new PanelTest();
    t.setVisible(true);
  }

  PanelTest()
  {
    KPanel p = getMainContainer();

    p.setLayout(new FlowLayout());

    t_one = new JTextField(5);
    p.add(t_one);

    t_two = new JTextField(5);
    p.add(t_two);

    t_three = new JTextField(5);
    p.add(t_three);

    KPanel p_foo = new KPanel();
    p_foo.setLayout(new FlowLayout());

    b_one = new KButton("one");
    p_foo.add(b_one);

    b_two = new KButton("two");
    p_foo.add(b_two);

    p_foo.setFocusCycleRoot(true);
    p_foo.setFocusOrder(new JComponent[] { b_two, b_one });

    p.add(p_foo);

    t_four = new JTextField(5);
    p.add(t_four);

    p.setFocusCycleRoot(true);
    p.setFocusOrder(new JComponent[] { t_one, p_foo, t_two, t_four, t_three });

    KLabel vl = new KLabel("This is a test of vertical label");
    vl.setUI(new VerticalLabelUI(false));

    p.add(vl);

    pack();
    
  }
}
